﻿using Common.SqlSugar;
using MyBlog.Model.Entity;
using MyBlog.Model.Other;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace MyBlog.IService
{
    public interface IBlogService: IBaseService<Blog>
    {
        /// <summary>
        /// 按创建日期分页查询
        /// </summary>
        /// <param name="page">当前页</param>
        /// <param name="size">每页的数量</param>
        /// <param name="total">总数</param>
        /// <param name="order">是否正序</param>
        /// <returns></returns>
        Task<List<Blog>> QueryOrderbyTime(Expression<Func<Blog, bool>> expression, int page, int size, RefAsync<int> total, bool order=true);
        /// <summary>
        /// 按最多访问分页查询
        /// </summary>
        /// <param name="page">当前页</param>
        /// <param name="size">每页的数量</param>
        /// <param name="total">总数</param>
        /// <param name="order">是否正序</param>
        /// <returns></returns>
        Task<List<Blog>> QueryOrderbyMaxAccess(Expression<Func<Blog, bool>> expression, int page, int size, RefAsync<int> total, bool order=true);


    }
}
